<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>动态绑定属性和属性值</title>
</head>
<body>
<div id="app">
    <div id="change" class="change">
        <img v-bind:[attribute_name]="attribute_value" alt=""/>
    </div>
</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let attribute_name = "src"
                let attribute_value = "https://consumer.huawei.com/content/dam/huawei-cbg-site/common/mkt/pdp/phones/mate-x3/img/kv/kv@2x.webp"
                return {
                    attribute_name,
                    attribute_value,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>